﻿using Seggu.Daos.Interfaces;
using Seggu.Dtos;
using Seggu.Services.DtoMappers;
using Seggu.Services.Interfaces;
using System.Collections.Generic;
using System.Linq;

namespace Seggu.Services
{
    public sealed class VehicleTypeService : IVehicleTypeService
    {
        private IVehicleTypeDao VehicleTypeDao;

        public VehicleTypeService(IVehicleTypeDao VehicleTypeDao)
        {
            this.VehicleTypeDao = VehicleTypeDao;
        }
        public IEnumerable<VehicleTypeDto> GetAll()
        {
            var vehicletype = this.VehicleTypeDao.GetAll();
            return vehicletype.OrderBy(x => x.Name).Select(vt => VehicleTypeDtoMapper.GetDto(vt));
        }
    }
}
